package cn.myschool.admin2.dao;

import cn.myschool.admin2.entity.Admin;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */

@Service
public class AdminDao {
    static List<Admin> datas=new ArrayList<>();

    public boolean login(String u,String p){
        return "admin".equals(u)&&"123".equals(p);
    }

    public int add(Admin a){
        datas.add(a);
        System.out.println("用户添加成功");
        return 1;
    }
    public List<Admin> search(){
        return  datas;
    }
}
